package models

import "gorm.io/gorm"

type Novel struct {
	gorm.Model
	Title   string `gorm:"type:varchar(50);not null; commit:'标题'"`
	TypeId  int    `gorm:"type:int(150);not null; commit:'类型ID'"`
	Num     int    `gorm:"type:int(50);not null; commit:'数量'"`
	Connect string `gorm:"type:varchar(150);not null; commit:'内容'"`
	Image   string `gorm:"type:varchar(150);not null; commit:'照片'"`
}
type NovelTypeId struct {
	gorm.Model
	Name string
}
type NovelData struct {
	Novel
	Name string
}

func (n *Novel) Add() error {
	return DB.Create(&n).Error
}
